package com.erclab.xpresso.forms
{
	import mx.controls.Button;	
	import com.erclab.xpresso.FormManager;
	
	public class FormItemManager{
		
		/* THIS CLASS MUST REPLACE THE FUNCTIONS THAT 
		ARE USED WHEN USING A FORM SEPARATELY
		
		TODO
		
		public var itemFormListener:FormListener;
		public var UpdateItemButton:Button;
		public var InsertNewItemButton:Button;
		public var InsertItemButton:Button;
		
		protected var theFormManager:FormManager;
		
		public function FormItemManager(theFormManager:FormManager){
			this.theFormManager = theFormManager;
		}
		
		public function itemSelected(theItem:Object):void{
			if (theItem != null){
				theFormManager.fillFormWithObject(theItem);
				UpdateItemButton.enabled = true;
				InsertNewItemButton.enabled = true;
				InsertItemButton.enabled = false;
			}
			
		}
		
		public function updatePartner():void{
			theFormManager.action = "update";
			theFormManager.insertData();
		}
	
		public function prepareForNewPartner():void{
			theFormManager.clearForm();
			UpdateItemButton.enabled = false;
			InsertNewItemButton.enabled = false;
			InsertItemButton.enabled = true;
		}
		
		public function insertPartner():void{
			theFormManager.action = "insert";
			theFormManager.insertData();	
			theFormManager.clearForm();
		}
		*/
	}
}